package com.validators;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

@Target({ ElementType.TYPE, ElementType.ANNOTATION_TYPE })
@Retention(RUNTIME)
@Constraint(validatedBy = NotNullMultipleValidator.class)
@Documented
public @interface NotNullMultiple {
	String message() default "Debe completar al menos un campo";

	Class<?>[] groups() default {};

	Class<? extends Payload>[] payload() default {};

	/**
	 * Propiedad a validar
	 */
	String property() default "nombre";

	
	@Target({ ElementType.TYPE, ElementType.ANNOTATION_TYPE })
	@Retention(RUNTIME)
	@Documented
	@interface List {
		NotNullMultiple[] value();
	}

}
